Entering Script Information in Raw Format
You can enter double angle brackets, or chevrons («»), directly into a script by typing Option-Backslash and Shift-Option-Backslash. There are several reasons you might choose to do this:
-
You're creating a script at home to use on a work machine that is running a newer version of the Mac OS or a newer version of a scriptable application or scripting addition. Drawing from the example in
When a Dictionary Is Not Available, suppose you want to use the scripting addition command Delay, but are running Mac OS 8, which doesn't support that command. At home, you can write «event sysodela» 4 in your script. When you open the script at work, AppleScript converts the term to delay 4. A problem with this approach is that you can't check the validity of your script until you try it on the target machine.
-
You know that an application supports a certain Apple event but it doesn't supply terminology for the event in its dictionary. For example, if you're a developer creating a scriptable application, you may want to test a feature you've added to the code but not yet added to the application's dictionary.
You can also use AppleScript to insert chevrons into a script, using the following steps:
-
Create a script using standard terms compiled against an available application or scripting addition.
-
Save the script as text and quit the Script Editor.
-
Remove the application or scripting addition from the computer.
-
Open the script again and compile it.
-
When AppleScript asks you to locate the application or scripting addition, specify a file that doesn't contain a terminology.
The script will compile successfully, but the Script Editor will display the script with chevron format for any terms that rely on a missing dictionary. (To recompile the script again and supply the correct dictionary, save it as text and quit the Script Editor again, then open and recompile it, specifying the correct application or scripting addition.)
There are several situations in which you might want to recompile a script this way.
-
You're creating a script that will target an application on a remote machine. AppleScript doesn't currently allow you to compile against the dictionary of an application or scripting addition on a remote machine. If you compile using a local copy of the application, you are not only using its dictionary (which may be the same as for the remote application), you are also targeting the local application. However, you can write and compile the script with the local version of the application, insert chevrons as described above so that the target is no longer the local application, then type in the remote machine target, as described in
References to Remote Applications.
-
You want a Tell block loop variable to loop over items (such as disk drives) on a remote machine. As described in the previous item, you can compile your script using a local copy of the application, insert chevrons as described above, then type in the remote machine target.
© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)